<%--
  Created by IntelliJ IDEA.
  User: 29960
  Date: 2022/8/24
  Time: 9:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--<!DOCTYPE html>--%>
<%String path= request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>预售卡</title>
    <link type="text/css" rel="stylesheet" href="<%=path%>/admin/car/fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="<%=path%>/admin/car/css/style.css"/>
</head>
<body>
<div class="main_box">
    <h2><span></span>添加预售卡</h2>
    <div class="cont_box">
        <form action="${pageContext.request.contextPath}/admin/addChard" method="post" id="presell_form">
            <ul class="addpro_box">
                <li>
                    <label>预售编号：</label>
                    <input type="number" name="B_presale" required data-msg-required="预售编号不能为空">
                </li>
                <li>
                    <label>预售卡卡种：</label>
                    <select name="B_cardid" id="zl" required data-msg-required="预售卡卡种不能为空">
                        <option value="">请选择</option>
                        <c:forEach items="${one}" var="one">
                            <option <c:if test="${one.b_card_name=='储值卡'}">value="1" </c:if><c:if test="${one.b_card_name=='年卡'}">value="2" </c:if>>${one.b_card_name}</option>
                        </c:forEach>
<%--                        <option value="2">年卡</option>--%>
                    </select>
                </li>
                <li>
                    <label>储值卡种类：</label>
                    <select name="B_cardtype" id="cx" required data-msg-required="储值卡种类不能为空">
                        <option value="">请选择</option>
                        <c:forEach items="${card}" var="ca">
                        <option <c:if test="${ca.b_cardid_two_name=='都市储值卡'}">value="1"</c:if><c:if test="${ca.b_cardid_two_name=='白金储值卡'}">value="2"</c:if><c:if test="${ca.b_cardid_two_name=='红钻储值卡'}">value="3"</c:if>>${ca.b_cardid_two_name}</option>
                        </c:forEach>
<%--                        <option value="2">储值卡种类二</option>--%>
                    </select>
                </li>
                <li>
                    <label>年卡种类：</label>
                    <select name="B_cardtype" id="year" required data-msg-required="年卡种类不能为空">
                        <option value="">请选择</option>
                        <c:forEach items="${nian}" var="nian">
                        <option <c:if test="${nian.b_cardid_two_name=='都市年卡'}">value="1" </c:if><c:if test="${nian.b_cardid_two_name=='白金年卡'}">value="2" </c:if><c:if test="${nian.b_cardid_two_name=='红钻年卡'}">value="3" </c:if>>${nian.b_cardid_two_name}</option>
                        </c:forEach>
<%--                        <option value="2">年卡种类二</option>--%>
                    </select>
                </li>
                <li>
                    <label>卡号：</label>
                    <input type="text" placeholder="请输入预售卡卡号" name="B_cardnumber" required data-rule-sellcard="true" data-msg-required="预售卡卡号不能为空"/>
                </li>
                <li>
                    <label>充值金额：</label>
                    <input type="text" name="B_rechargeamount"/>
                </li>
                <li>
                    <label>是否支付：</label>
                    <div class="radio_box">
                        <i class="fa fa-check-circle fa-1x"></i>
                        <input type="radio" name="B_paymentstatus" class="input_radio" checked="checked" value="1"/><span>已支付</span>
                    </div>
                    <div class="radio_box">
                        <i class="fa fa-circle-thin fa-1x"></i>
                        <input type="radio" name="B_paymentstatus" class="input_radio" value="0"/><span>未支付（送客户）</span>
                    </div>
                </li>
                <li>
                    <label>会员：</label>
                    <select name="C_membernumber">
                        <option value="">请选择</option>
                        <c:forEach items="${hy}" var="hy">
                            <option value="${hy.c_membernumber}">${hy.c_name}</option>
                        </c:forEach>
                        <%--                        <option value="2">李四</option>--%>
                    </select>
                </li>
                <li>
                    <label>销售：</label>
                    <select name="B_employee">
                        <option value="">请选择</option>
                        <c:forEach items="${all}" var="all">
                        <option value="${all.b_employee}">${all.z_name}</option>
                        </c:forEach>
<%--                        <option value="2">李四</option>--%>
                    </select>
                </li>
                <li>
                    <label>是否售出：</label>
                    <div class="radio_box">
                        <i class="fa fa-check-circle fa-1x"></i>
                        <input type="radio" name="B_Sold" class="input_radio" checked="checked" value="1"/><span>已售出</span>
                    </div>
                    <div class="radio_box">
                        <i class="fa fa-circle-thin fa-1x"></i>
                        <input type="radio" name="B_Sold" class="input_radio" value="0"/><span>未售出（退款）</span>
                    </div>
                </li>
            </ul>
            <div class="probtn_box clearfix">
<%--                class="btn blue_btn submit--%>
                <input type="submit" value="添加预售"/>
            </div>
        </form>
    </div>
</div>
<!--javascript include-->
<script src="<%=path%>/admin/car/js/jquery-2.2.1.min.js"></script>
<script src="<%=path%>/admin/car/js/jquery.dataTables.min.js"></script>
<script src="<%=path%>/admin/car/js/bootstrap-datepicker.js"></script>
<script src="<%=path%>/admin/car/js/jquery.validate.min.js"></script>
<script src="<%=path%>/admin/car/js/jquery.form.min.js"></script>
<script src="<%=path%>/admin/car/js/other.js"></script>
<script>
    $(function(){
        <%--$("body").other({formId:"#presell_form",formUrl:"${pageContext.request.contextPath}/admin/addChard"});//formUrl 表单请求地址--%>
        //卡种显示隐藏
        $("select[id='cx']").parent().hide();
        $("select[id='year']").parent().hide();
        $("select[id='zl']").change(function(){
            var now = $(this).val();
            if(now == "1"){
                $("select[id='cx']").prop("disabled",false).parent().show();
                $("select[id='year']").prop("disabled",true).parent().hide();
            }else if(now == "2"){
                $("select[id='year']").prop("disabled",false).parent().show();
                $("select[id='cx']").prop("disabled",true).parent().hide();
            }else{
                $("select[id='year']").parent().hide();
                $("select[id='cx']").parent().hide();
            }
        });
    });
</script>
</body>
</html>
